package com.fantuan.web;

import java.util.HashMap;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.fantuan.mail.MailService;

@Controller
public class TestAction {

	@Autowired
	@Qualifier("mailService")
	private MailService mailService;
	
	//邮件测试
	@RequestMapping("/test/mail.do")
	public void processMail(HttpServletRequest request,
			HttpServletResponse response)
	{
		Map<String, Object> model = new HashMap<String, Object>();
		model.put("user", "你好你好");
		
		String subject = "中国中国";
		String vmfile = "mail/test.vm";
		String[] mailTo = new String[]{"x@q3c.cn"};
		
		mailService.sendEmail(model, subject, vmfile, mailTo, null);
	}

}
